package org.hcyspartnoc.demo;

import org.hcyspartnoc.demo.utils.StringUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.time.LocalDateTime;

@EnableAsync
@EnableScheduling
@EnableAspectJAutoProxy
@SpringBootApplication
@EnableTransactionManagement
@ComponentScan("org.hcyspartnoc")
@MapperScan(basePackages = {"org.hcyspartnoc.**.mapper"})
public class KnowledgeGraphBackendApplication {

    public static void main(String[] args) {
        SpringApplication.run(KnowledgeGraphBackendApplication.class, args);
        printStartSuccess();

    }

    private static void printStartSuccess(){

        // 使用System.out.println输出炫酷的服务器启动提示
        System.out.println("╭────────────────────────────────────────");
        System.out.println("│                                        ");
        System.out.println("│    🚀  Server Starting...              ");
        System.out.println("│    ---------------------------------     ");
        System.out.println("│    🕒 " + StringUtils.formatDateTime(LocalDateTime.now()));
        System.out.println("│    🌐 Listening on port 8080...          ");
        System.out.println("│                                        ");
        System.out.println("│    🌈 Loading configurations...         ");
        System.out.println("│    🔧 Initializing databases...         ");
        System.out.println("│    🔍 Verifying system integrity...     ");
        System.out.println("│    🔧 Setting up services...            ");
        System.out.println("│                                        ");
        System.out.println("│    🚀 Server Ready!                    ");
        System.out.println("│                                        ");
        System.out.println("╰────────────────────────────────────────");
    }

}
